#define _CRT_SECURE_NO_WARNINGS 1
#include"List.h"

void TestList1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);

	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPushBack(plist, 5);
	LTPrint(plist);
	LTPopBack(plist);
	LTPrint(plist);

	LTPushFront(plist, 10);
	LTPrint(plist);



}
void TestList2()
{
	LTNode* plist = LTInit();
	LTPushFront(plist, 10);
	LTPushFront(plist, 20);
	LTPushFront(plist, 30);
	LTPushFront(plist, 40);
	LTPrint(plist);

	LTPrint(plist);
	LTPopFront(plist);
	LTPopFront(plist); 
	LTPopFront(plist);
	LTPopFront(plist);
	LTPopFront(plist);

	LTPrint(plist);


}
void TestList3()
{
	LTNode* plist = LTInit();
	LTPushFront(plist, 10);
	LTPushFront(plist, 20);
	LTPushFront(plist, 30);
	LTPushFront(plist, 40);
	LTPrint(plist);

	LTNode* pos = LTFind(plist, 30);
	if (pos)
	{
		pos->val *= 10;
	}
	LTPrint(plist);

	LTInsert(pos, 3000);
	LTPrint(plist);
	LTInsert(plist, -1);
	LTPrint(plist);


}
void TestList4()
{
	LTNode* plist = LTInit();
	LTPushFront(plist, 10);
	LTPushFront(plist, 20);
	LTPushFront(plist, 30);
	LTPushFront(plist, 40);
	LTPrint(plist);

	LTNode* pos = LTFind(plist, 30);
	if (pos)
	{
		LTErase(pos);
		pos = NULL;

	}
	
	LTPrint(plist);

	LTDestroy(plist);
	plist = NULL;
}
int main()
{
	
	TestList4();

	return 0;
}